package com.baidu.day03;

import java.io.File;

public class Demo05 {
    public static void main(String[] args) {
        File f = new File("C:\\Users\\DAJU\\Desktop\\新建文件夹 (2)");
        rename(f);
    }

    public static void rename(File file) {
        File[] files = file.listFiles();
        for (File f : files) {
        if (f.isDirectory())  {
            rename(f);
        }
            String parant = f.getParent();
            File newfile = new File(parant + "\\" + "888" +f.getName());
            f.renameTo(newfile);
        }
    }


}
